package com.zrc.module_moments.fragment

import com.alibaba.android.arouter.facade.annotation.Route
import com.zrc.superframe_base.ARouterHub
import com.zrc.superframe_base.mvx.mvvm.BaseMvvmFragment
import com.zrc.module_moments.viewmodel.MomentsVM
import com.zrc.module_moments.databinding.FragmentMomentsBinding
import com.zrc.module_moments.*

/**
 * @Author: superman
 * @CreateTime: 6/27/21
 * @Describe:
 */
@Route(path = ARouterHub.FRAGMENT_MOMENTS, name = "朋友圈")
class MomentsFragment : BaseMvvmFragment<FragmentMomentsBinding, MomentsVM>() {

    private var list = arrayListOf<String>()

    override fun getVariableId() = BR.viewModel

    override fun getLayoutId() = R.layout.fragment_moments

    override fun getViewModel() = MomentsVM(this)

    override fun initObserver() {
        super.initObserver()
        //mBinding.container.show<MyLoadState>()//初始菊花屏
        mBinding.smartRefreshLayout.setOnRefreshListener {
            list.clear()
            mBinding.smartRefreshLayout.finishRefresh(2000)
        }

        mBinding.smartRefreshLayout.setOnLoadMoreListener {
            mBinding.smartRefreshLayout.finishLoadMore(2000)
        }
    }
}